<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="dc20941">DROP RESOURCE QUEUE</title><body><p id="sql_command_desc">Removes a resource queue.</p><section id="section2"><title>Synopsis</title><codeblock id="sql_command_synopsis">DROP RESOURCE QUEUE <varname>queue_name</varname></codeblock></section><section id="section3"><title>Description</title><p>This command removes a resource queue from Greenplum
Database. To drop a resource queue, the queue cannot have any roles assigned
to it, nor can it have any statements waiting in the queue. Only a superuser
can drop a resource queue.</p></section><section id="section4"><title>Parameters</title><parml><plentry><pt><varname>queue_name</varname></pt><pd>The name of a resource queue to remove.</pd></plentry></parml></section><section id="section5"><title>Notes</title><p>Use <codeph><xref href="ALTER_ROLE.xml#topic1" type="topic" format="dita"/></codeph> to remove a
        user from a resource queue.</p><p>To see all the currently active queries for all resource queues, perform
the following query of the <codeph>pg_locks</codeph> table joined with
the <codeph>pg_roles</codeph> and <codeph>pg_resqueue</codeph> tables:</p><codeblock>SELECT rolname, rsqname, locktype, objid, pid, 
mode, granted FROM pg_roles, pg_resqueue, pg_locks WHERE 
pg_roles.rolresqueue=pg_locks.objid AND 
pg_locks.objid=pg_resqueue.oid;</codeblock><p>To see the roles assigned to a resource queue, perform the following query
of the <codeph>pg_roles</codeph> and <codeph>pg_resqueue</codeph> system
catalog tables:</p><codeblock>SELECT rolname, rsqname FROM pg_roles, pg_resqueue WHERE 
pg_roles.rolresqueue=pg_resqueue.oid;</codeblock></section><section id="section6"><title>Examples</title><p>Remove a role from a resource queue (and move the role to the default
resource queue, <codeph>pg_default</codeph>):</p><codeblock>ALTER ROLE bob RESOURCE QUEUE NONE;</codeblock><p>Remove the resource queue named <codeph>adhoc</codeph>:</p><codeblock>DROP RESOURCE QUEUE adhoc;</codeblock></section><section id="section7"><title>Compatibility</title><p>The <codeph>DROP RESOURCE QUEUE</codeph> statement is a Greenplum Database extension. </p></section><section id="section8"><title>See Also</title><p><codeph><xref href="ALTER_RESOURCE_QUEUE.xml#topic1" type="topic" format="dita"/></codeph>,
            <codeph><xref href="CREATE_RESOURCE_QUEUE.xml#topic1" type="topic" format="dita"
          /></codeph>, <codeph><xref href="ALTER_ROLE.xml#topic1" type="topic" format="dita"
          /></codeph></p></section></body></topic>
